#ifndef STRINGSPLITTER_H_
#define STRINGSPLITTER_H_

#include <e32std.h>
#include <e32base.h>
#include <gdi.h>
#include "LinkTemplate.h"
#include "RPointerStack.h"
#include "TextBlock.h"
#include "TextContentHandler.h"
#include "TextLineLink.h"

class CStringSplitter : public CBase
{
public:
	CStringSplitter();
	virtual ~CStringSplitter();
	
public:
	static CStringSplitter* NewL(const TDesC& aDes);
	static CStringSplitter* NewLC(const TDesC& aDes);
public:
	void ConstructL(const TDesC& aDes);
	
public:
	void ParseL();
	void SplitTextBlock(TInt aWidth);
	TSize EstimateSize();
	void Layout(const TRect& aRc);
	void Draw(CGraphicsContext& aGc);
	
public:
	TSize GetContentSize()
		{
		return iFormatTextLineLink.iBound;
		}
	
private:
	HBufC* iText;
	CTextContentHandler* iTextContentHandler;
	
	TextLineLink iFormatTextLineLink;
	LinkTemplate iOriginTextLink;
	
	
};

#endif /*STRINGSPLITTER_H_*/
